package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreEntyTelUsesPK;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;


@Entity
@NamedQuery(name = "RimCoreEntyTelUses.findAll", query = "select o from RimCoreEntyTelUses o")
@Table(name = "RIM_CORE_ENTY_TEL_USES")
@IdClass(RimCoreEntyTelUsesPK.class)
public class RimCoreEntyTelUses implements Serializable {
    @Id
    @Column(name="ENTITY_ID", nullable = false, insertable = false,  updatable = false)    private Long entityId;
    @Id
    @Column(name="ENTITY_VERSION_NUM", nullable = false, insertable = false, updatable = false)    private Long entityVersionNum;
    @Id
    @Column(name="TEL_ADDRESS_ID", nullable = false, insertable = false, updatable = false)    private Long telAddressId;
    @Id
    @Column(name="USE_CODE", nullable = false)    private String use;
    
    @ManyToOne
    @JoinColumns({
    @JoinColumn(name = "ENTITY_ID", referencedColumnName = "ENTITY_ID"),
    @JoinColumn(name = "ENTITY_VERSION_NUM", referencedColumnName = "ENTITY_VERSION_NUM"),
    @JoinColumn(name = "TEL_ADDRESS_ID", referencedColumnName = "TEL_ADDRESS_ID")
    })
    private RimCoreEntyTelAddrs rimCoreEntyTelAddrs;

    public RimCoreEntyTelUses() {
    }

    public Long getEntityId() {
        return entityId;
    }

    public void setEntityId(Long entityId) {
        this.entityId = entityId;
    }

    public Long getEntityVersionNum() {
        return entityVersionNum;
    }

    public void setEntityVersionNum(Long entityVersionNum) {
        this.entityVersionNum = entityVersionNum;
    }

    public Long getTelAddressId() {
        return telAddressId;
    }

    public void setTelAddressId(Long telAddressId) {
        this.telAddressId = telAddressId;
    }

    public RimCoreEntyTelAddrs getRimCoreEntyTelAddrs() {
        return rimCoreEntyTelAddrs;
    }

    public void setRimCoreEntyTelAddrs(RimCoreEntyTelAddrs rimCoreEntyTelAddrs) {
        this.rimCoreEntyTelAddrs = rimCoreEntyTelAddrs;
    }

    public void setUse(String use) {
        this.use = use;
    }

    public String getUse() {
        return use;
    }
}
